#App ID
APP_ID="service"

# War file
JAR_FILE="service.jar"

# JVM OPTS
JVM_OPTS="-XX:+UseParallelGC -Xms128m -Xmx512m"

# Spring OPTS
SPRING_OPTS="--spring.profiles.active=prod"
SPRING_OPTS="${SPRING_OPTS} --logging.file=logs/log.log"

# Log file
PID_FILE=".$APP_ID.tpid"
LOG_FILE="$APP_ID.log"

# Run script
rm -f $PID_FILE
rm -f $LOG_FILE

nohup java $JVM_OPTS -jar $JAR_FILE $SPRING_OPTS > $LOG_FILE 2>&1 &
echo $! > $PID_FILE
